//
//  Ext+UIAppliacation.swift
//  DocScaner
//
//  Created by liyahao on 2025/8/13.
//

import UIKit

extension UIApplication {
    /// 获取window
    static var window: UIWindow? {
        // 1. 获取所有连接到应用的场景
        if let scene = UIApplication.shared.connectedScenes.first,
           // 2. 确保它是一个 UIWindowScene
           let windowScene = scene as? UIWindowScene {
            // 3. 获取该场景的主窗口
            return windowScene.windows.first
        }
        return nil
    }
}
